package com.sanploy.manage.mapper;


import com.sanploy.common.domain.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by zhu yingzhi on 2017/10/18.
 */
@Mapper
public interface ChartMapper {

    /**
     * 获取指定天数的的订单
     * @param day 天数
     * @return order实体 集合
     */
    @Select("SELECT * FROM orders WHERE order_status not in('NotPay','Cancelled') And add_time >=  DATE_SUB(NOW(),INTERVAL #{day} DAY);")
    List<Order> getRecentOrderSales(@Param("day") int day);
}
